package com.atguigu.gmall.activity.config;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

/**
 * @Author: 李旭
 * @Time: 16:04
 * @Description:
 *
 *  监听接收到消息之后 处理实现类
 */
@Component
public class MessageReceive {


    //接收消息 的方法
    public void receiveMessage(String message){
        //message   "skuId:1"
        System.out.println("1Redis接收到的消息：" + message);
        message = message.replaceAll("\"","");
        //message   skuId:1
        //切割
        String[] m = message.split(":");
        System.out.println("2Redis接收到的消息：" + message);
        //本地缓存中  JUC 是不是本地缓存
        CacheHelper.put(m[0],m[1]);
    }
}
